Combat-Reports-should-include-wreckage-created-section-#1175#1301
Conversation
|
Hi @piciolo, I just tested your changes. I noticed the players with the General class are not included in your changes. They too create wreckage that is transported back, as long as there is one surviving ship that makes it back to the origin. Your branch is also behind on the latest changes. There was a substantial addition in |
|
Thanks for the heads-up and the thorough review! You're absolutely right about the General class wreckage logic—I missed that specific "surviving ship" requirement. I also noticed my branch was out of sync with the recent substantial changes in AttackMission.php. I've just updated everything and it's now fully aligned. Let me know if I should push the updates to this same PR or if you'd prefer a fresh, clean one. Thanks! |
Updating is fine, we'll squash the commits into one later. |
| 'battle_share' => 'share message', | ||
| 'battle_repaired_def' => 'Repaired defences', | ||
| 'battle_wreckage_created' => 'Wreckage created', | ||
| 'battle_attacker_wreckage' => 'Attacker wreckage (General)', |
There was a problem hiding this comment.
Do you have any experience or confirmation that this is the exact wording of wreckage created for attackers with the General class? If not, we should default to Wreckage created.
| @if ($wreckage_count > 0) | ||
| <div class="section_title"> | ||
| <div class="c-left"></div> | ||
| <div class="c-right"></div> | ||
| <span class="title_txt">{{ __('t_ingame.messages.battle_wreckage_created') }}: {{ $wreckage_count }}</span> | ||
| </div> | ||
| <ul class="detail_list clearfix wreckageContainer"> | ||
| @foreach ($wreckage_units->units as $unit) | ||
| <li class="detail_list_el"> | ||
| <div class="wreckage_icon float_left"> | ||
| <img width="28" height="28" alt="{{ $unit->unitObject->title }}" src="{{ asset('img/objects/units/' . $unit->unitObject->assets->imgMicro) }}"> | ||
| </div> | ||
| <span class="detail_list_txt">{{ $unit->unitObject->title }}</span> | ||
| <span class="fright" style="margin-right: 10px">{{ $unit->amount }}</span> | ||
| </li> | ||
| @endforeach | ||
| </ul> | ||
| @endif | ||
|
|
||
| @if ($attacker_wreckage_count > 0) | ||
| <div class="section_title"> | ||
| <div class="c-left"></div> | ||
| <div class="c-right"></div> | ||
| <span class="title_txt">{{ __('t_ingame.messages.battle_attacker_wreckage') }}: {{ $attacker_wreckage_count }}</span> | ||
| </div> | ||
| <ul class="detail_list clearfix attackerWreckageContainer"> | ||
| @foreach ($attacker_wreckage_units->units as $unit) | ||
| <li class="detail_list_el"> | ||
| <div class="wreckage_icon float_left"> | ||
| <img width="28" height="28" alt="{{ $unit->unitObject->title }}" src="{{ asset('img/objects/units/' . $unit->unitObject->assets->imgMicro) }}"> | ||
| </div> | ||
| <span class="detail_list_txt">{{ $unit->unitObject->title }}</span> | ||
| <span class="fright" style="margin-right: 10px">{{ $unit->amount }}</span> | ||
| </li> | ||
| @endforeach | ||
| </ul> | ||
| @endif | ||
|
|
There was a problem hiding this comment.
Each player should only have their individual wreckage displayed.
| 'battle_repaired_def' => 'Repaired defences', | ||
| 'battle_share' => 'share message', | ||
| 'battle_repaired_def' => 'Repaired defences', | ||
| 'battle_wreckage_created' => 'Wreckage created', | ||
| 'battle_attacker_wreckage' => 'Attacker wreckage (General)', |
There was a problem hiding this comment.
These and similar translation keys should not be part of this PR. Please focus on one issue at a time and hand in other changes separately. #1297 already aims to include many of the translations, these changes would be best suited there.
6d9cafd to
6b8b135
Compare
There was a problem hiding this comment.
Why are these changes necessary?
There was a problem hiding this comment.
That idiot git pushed this too
There was a problem hiding this comment.
I’m currently running a test on the entire project to check for any further errors, and then I’ll apply a fix
There was a problem hiding this comment.
Removed the .github/workflows/sync-upstream.yml file, which was mistakenly included during the upstream sync.
Implemented the requested logic for battle reports: each player will now see only their individual wreckage instead of the global total, ensuring data clarity for all participants.
Persist and display wreckage data in battle reports. BattleReport now aggregates wreckage and attacker_wreckage into UnitCollection instances and exposes counts/units to the view. AttackMission saves defender wreckField ships to report->wreckage and computes a General-class attacker's wreck field (attacker_wreckage) when attacker survives. The blade template was updated to render wreckage and attacker wreckage sections with icons and counts.
6b8b135 to
0accd00
Compare
Add a viewer_is_attacker flag to BattleReport (compare message.user_id to battleReportModel.attacker.player_id) and update the battle report Blade template to only show defender wreckage to non-attackers and attacker wreckage to the attacker. This prevents both wreckage sections from being visible to the wrong recipient and ensures each player sees only their relevant wreckage information.
Add two new translation keys (battle_wreckage_created, battle_attacker_wreckage) to English, Italian and Dutch in-game language files for battle UI. Also normalize spacing/alignment of the existing battle_debris_new entries.
|
I just merged #1326, could you please update this branch again to sync up with the latest changes so we can get a preview environment up and running? Thanks! |
…-include-wreckage-created-section-lanedirt#1175
Preview deployment
Preview environment has been cleaned up. |
Done |
lanedirt
left a comment
There was a problem hiding this comment.
LGTM, thanks for the work on this both!

Description
This PR implements the persistence and display of the "Wreckage created" section within combat reports, specifically for battles involving a Space Dock.
Changes:
Backend Persistence: AttackMission now extracts ship data from battleResult.wreckField and persists it into the report->wreckage attribute during battle report creation.
Data Processing: BattleReport has been updated to extract this data into a UnitCollection (following the existing pattern for repaired defenses), providing $wreckage_count and $wreckage_units to the view.
Frontend UI: The battle_report_full.blade.php template now includes a dedicated section for wreckage, complete with unit icons and counts, positioned before the Wreck Field summary.
Localization: Added the battle_wreckage_created translation key for English, Italian, and Dutch.
Type of Change:
[ ] Bug fix
[x] Feature enhancement
[ ] Documentation update
[ ] Other (please describe):
Related Issues
Fixes #1175
Checklist
[x] Automated Refactoring: Rector has been run and no outstanding issues remain.
[x] Code Standards: Code adheres to PSR-12 coding standards. Verified with Laravel Pint.
[x] Static Analysis: Code passes PHPStan static code analysis.
[x] Testing:
Relevant unit and feature tests are included or updated.
Tests successfully run locally.
[x] CSS & JS Build: CSS and JS assets are compiled using Laravel Mix.
Additional Information
Existing combat reports in the database will remain functional. Since they lack the wreckage data, the new section will simply not be rendered for them, ensuring full backward compatibility.